{
  "properties" : { },
  "id" : "030c28ea490f41ffbdc8093d4232fa86",
  "script" : null,
  "groupId" : "529eeecd4835424bb618862abdac111a",
  "name" : "上传mib",
  "createTime" : 1727070984859,
  "updateTime" : 1726306010900,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "import",
  "method" : "POST",
  "parameters" : [ {
    "name" : "fileList",
    "value" : {
      "0" : { }
    },
    "description" : "",
    "required" : false,
    "dataType" : "MultipartFiles",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  } ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 500,\n    \"success\": false,\n    \"data\": {},\n    \"msg\": \"系统维护中，请稍后重试。\"\n}",
  "description" : "",
  "requestBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  },
  "responseBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "Object",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "code",
      "value" : "500",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "success",
      "value" : "false",
      "description" : "",
      "required" : false,
      "dataType" : "Boolean",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "data",
      "value" : "",
      "description" : "",
      "required" : false,
      "dataType" : "Object",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "msg",
      "value" : "系统维护中，请稍后重试。",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  }
}
================================
 import com.kd.ndmp.biz.device.model.MibParser;
 import com.lms.snmp.mib.MibTree;
 File file = new File("mibs");
        for (multipartFile in fileList) {
            String originalFilename = multipartFile.originalFilename;
            multipartFile.transferTo(new File(file.absolutePath + "/" + originalFilename));
        }
        MibParser parser = new MibParser();
        if (!file.exists()) {
            file.mkdirs();
        }

        for (multipartFile in fileList) {
            try {
                parser.loadFromLocal(multipartFile.originalFilename);
            } catch (e) {
                e.printStackTrace();
            }
        }
        List  collect = this.list().stream().map(e->e.oid).collect(Collectors.toList());
        Set mibTreeSet = parser.trees.stream().filter(mibTree -> !mibTree.getOid().endsWith(".0"))
                .filter(mibTree -> !collect.contains(mibTree.oid)).collect(Collectors.toSet());
        Set mibs = new HashSet();
        for ( tree in mibTreeSet) {
            Mib mib = {
            "id": IdUtil.getSnowflakeNextId(),  
            "name":(tree.name),
            "oid":(tree.oid),
            "parentOid":(tree.parentOid),
            "baseType":(tree.baseType),
            "status":(tree.status),
            "access":(tree.access),
            "kind":(tree.kind),
            "module":(tree.module),
            "description":(tree.description),
            "internal":(300L)
        }
            mibs.add(mib);
        }
        if (mibs.size() > 0) {
            this.root = this.tree();
        }
       var a= db.table("ndmp_mib").primary("id").batchInsert(mibs);
      return a? "导入成功" : "导入失败";

